<div class="header">
  <div class="header-content">
    <a class="header-logo" href="{:addon_url('wwh/index/index')}">
      <img class="logo1" src="{$site.logo|cdnurl}" alt="">
      <img class="logo2" src="{$site.logo1|cdnurl}" alt="">
    </a>
    <div class="header-right">
      <div class="header-nav">
        <ul>
          {volist name="nav" id="v"}
          <li {if $navCur.classify == $v.classify}class="cur"{/if} {if $v.childlist}class="has-sub"{/if}><a href="{if empty($v.diyname)}{$v.outlink}{else}{:addon_url('wwh/column/index', [':diyname'=>$v.diyname])}{/if}">{$v.name}</a>
            {if $v.childlist}
            <ul>
              {volist name="v.childlist" id="vv"}
              <li class="{if $vv.childlist}has-sub{/if}"><a href="{if empty($vv.diyname)}{$vv.outlink}{else}{:addon_url('wwh/column/index', [':diyname'=>$vv.diyname])}{/if}">{$vv.name}</a>
                {if $vv.childlist}
                <ul>
                  {volist name="vv.childlist" id="vvv"}
                  <li class="{if $vvv.childlist}has-sub{/if}"><a href="{if empty($vvv.diyname)}{$vvv.outlink}{else}{:addon_url('wwh/column/index', [':diyname'=>$vvv.diyname])}{/if}">{$vvv.name}</a>
                    {if $vvv.childlist}
                    <ul>
                      {volist name="vvv.childlist" id="vvvv"}
                      <li><a href="{if empty($vvvv.diyname)}{$vvvv.outlink}{else}{:addon_url('wwh/column/index', [':diyname'=>$vvvv.diyname])}{/if}">{$vvvv.name}</a></li>
                      {/volist}
                    </ul>
                    {/if}
                  </li>
                  {/volist}
                </ul>
                {/if}
              </li>
              {/volist}
            </ul>
            {/if}
          </li>
          {/volist}
        </ul>
      </div>
      <div class="header-search">
        {if $switch_lang == '1'}
        <div class="lang">
          <a href="javascript:;"><i><img src="__CDN__/assets/addons/wwh/images/lang.png" alt=""></i><span>{:__lang('English')}</span></a>
          <div class="lang-show">
            <ul>
              <a href="javascript:;" onclick="switchLang('zh-cn'); return false;">简体中文</a>
              <a href="javascript:;" onclick="switchLang('en'); return false;">English</a>
            </ul>
          </div>
        </div>
        <div class="m-lang">
          {if $lang == '1'}
          <a href="javascript:;" onclick="switchLang('en'); return false;">EN</a>
          {/if}
          {if $lang == '2'}
          <a href="javascript:;" onclick="switchLang('zh-cn'); return false;">CN</a>
          {/if}
        </div>
        {/if}
        <div class="search">
          <a href="javascript:;"><i><img src="__CDN__/assets/addons/wwh/images/so.svg" alt=""></i></a>
        </div>
      </div>
    </div>
  </div>
  <div class="search-show">
    <div class="search-show-content">
      <div class="search-show-top">
        <form name="search" id="search" method="get" action="{:addon_url('wwh/search/index')}">
          <input type="submit" class="search-submit" value="">
          <input type="text" class="search-input" placeholder="{:__lang('Search')}" id="keywords" name="keywords">
          <input type="hidden" value="1" name="type">
          <input type="hidden" value="1" name="page">
          <div class="close"></div>
        </form>
      </div>
    </div>
  </div>
</div>
<script>
  function switchLang(lang) {
    $.ajax({
      url: "{:addon_url('wwh/index/switch')}",
      type: 'POST',
      data: { lang: lang },
      dataType: 'json',
      success: function(response) {
        if (response.code == 1) {
          window.location.href = response.redirect_url;
        }
      }
    });
  }
</script>